import java.util.Scanner;

public class d069 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String input, output;
		int year;
		int n = Integer.parseInt(sc.nextLine());
		
		for(int i = 0; i < n; i++) {
			input = sc.nextLine();
			year = Integer.parseInt(input);
			if(year == 0) { return; }
			
			if( ( ( year % 4 == 0 ) && ( year % 100 != 0 ) || ( year % 400 == 0 ))) {
				output = "a leap year";
			} else {
				output = "a normal year";
			}
			
			System.out.println(output);
		} // next
	} // main
}